package com.job.springSea.work0714;

import java.io.IOException;

/**
 * @author 于春海
 * @version 1.0
 * @since 2022-07-14 15:18:44
 */
public class UseRuntime {
    public static void main(String[] args) throws IOException {
        Runtime runtime=Runtime.getRuntime();
        //gc exit
        System.out.println(runtime.availableProcessors());
        System.out.println(runtime.maxMemory()/1024/1024+"MB");
        System.out.println(runtime.totalMemory()/1024/1024+"MB");
        System.out.println(runtime.freeMemory()/1024/1024+"MB");
        //exec 执行 字符串形式的命令 得到一个进程
        runtime.exec("mspaint");
        runtime.exec("calc");
        runtime.exec("mstsc");
        //logoff 注销  shutdown - s -t  100秒关机
        runtime.exec("D:/Soft/QQ/Bin//QQ.exe");
    }
}